package com.jizhi.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jizhi.entity.Doctor;
import com.jizhi.mapper.DoctorMapper;
import com.jizhi.service.DoctorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 罗兆良
 * @since 2020-11-14
 */
@Service
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> implements DoctorService {
    @Resource
    private DoctorMapper doctorMapper;

    @Override
    public int insert(Doctor doctor) {
        return doctorMapper.insert(doctor);
    }

    @Override
    public List<Doctor> selectPage(Page page) {
        IPage<Doctor> doctorIPage = doctorMapper.selectPage(page, null);
        return doctorIPage.getRecords();

    }
}
